/*
 * CommentViewer.java
 *
 * Created on November 29, 2007, 4:20 PM
 */

package bloggerdesktop;

/**
 *
 * @author  Reimius Forunner
 */
public class CommentViewer extends javax.swing.JFrame {
    
    /** Creates new form CommentViewer */
    public CommentViewer(String comi[][]) {
        com="";
        for(int i=0;i<comi.length;i++)
        {
            com = com+comi[i][0]+"\n";
            com = com+comi[i][1]+"\n"+"\n";
        }
        initComponents();
    }
    String com;
    public void runit(String comi[][]){
        com="";
        for(int i=0;i<comi.length;i++)
        {
            com = com+comi[i][0]+"\n";
            com = com+comi[i][1]+"\n"+"\n";
        }
        initComponents();
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();

        //setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jEditorPane1.setText(com);
        jScrollPane1.setViewportView(jEditorPane1);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>
    public void setEditorPane(String[][] comments)
    {
        String com = "";
        
            for(int i=0;i<comments.length;i++)
            {
                com = com + comments[i][0] + "\n";
                com = com + comments[i][1] + "\n";
            }
        jEditorPane1.setText(com);
        jScrollPane1.setViewportView(jEditorPane1);
    }
    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration
    
}
